//
// Decompiled by Jadx - 461ms
//
package fg;

import android.app.Activity;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.t;
import androidx.constraintlayout.widget.i;
import cc.e;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import fg.b;
import fh.j;
import fi.a;
import fi.c;
import fi.m;
import fi.w;
import fm.l;
import fn.y;
import gc.ac;
import gc.bo;
import gc.bt;
import gc.cf;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import me.plusne.Adapter.Login.HookSetListAdapter;
import me.plusne.common.Http.Vote;
import me.plusne.common.Json.VoteComments;
import me.plusne.common.Json.VoteSubmit;
import r.f;
import r.g;
import s.aa;
import s.ak;
import s.am;
import s.ao;

public final class c implements b.b, w.c, w.e, w.b, ac.c {
    public final int a;
    public final int d;
    public final Object e;
    public final Object f;

    public c(Object obj, int i, Object obj2, int i2) {
        this.a = i2;
        this.e = obj;
        this.d = i;
        this.f = obj2;
    }

    public final void b(String str, Object[] objArr) {
        int[] iArr = (int[]) this.e;
        HashMap hashMap = (HashMap) this.f;
        String str2 = cf.cp;
        boolean contains = str.contains("success\":true");
        int i = this.d;
        if (contains) {
            iArr[0] = iArr[0] + 1;
            f i2 = f.i();
            i2.k();
            i2.l("[" + cf.cr + "]已执行 " + iArr[0] + "/" + i);
        }
        int i3 = iArr[0];
        if (i3 >= i) {
            f i4 = f.i();
            i4.n();
            i4.l("[" + cf.cr + "]执行完成 " + iArr[0] + " 次");
            return;
        }
        int[] iArr2 = {i3};
        ac acVar = new ac();
        acVar.de("https://api-user.soulapp.cn/user/voice/hit", hashMap, "JSON");
        acVar.dg(new c(iArr2, i, hashMap, 4));
    }

    public final void c(View view, c.a aVar, int i) {
        b.c cVar = (b.c) this.e;
        fi.c cVar2 = (fi.c) this.f;
        cVar.getClass();
        if (cVar2.isGroup() && aVar.isSwitch()) {
            for (int i2 = 0; i2 < cVar2.getList().size(); i2++) {
                if (((c.a) cVar2.getList().get(i2)).isSwitch()) {
                    if (((c.a) cVar2.getList().get(i2)).isSelected() && i2 != i) {
                        ((c.a) cVar2.getList().get(i2)).setSelected(false);
                    } else {
                        l lVar = cVar.d;
                        if (lVar != null && lVar.getItemCount() == 2 && i2 != i) {
                            ((c.a) cVar2.getList().get(i2)).setSelected(true);
                        }
                    }
                    l lVar2 = cVar.d;
                    if (lVar2 != null) {
                        lVar2.notifyItemChanged(i2);
                    }
                }
            }
        }
        cVar.b.c(this.d, i, aVar);
    }

    public final void g(w wVar, boolean z) {
        j.a aVar = (j.a) this.e;
        l lVar = (l) this.f;
        int i = j.a.a;
        aVar.getClass();
        if (z) {
            y.by.getDb().h(lVar);
            aVar.g.a.remove(lVar);
            if (aVar.getBindingAdapter() != null) {
                aVar.getBindingAdapter().notifyItemRemoved(this.d);
            }
        }
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        int i = this.a;
        Object obj = this.f;
        Object obj2 = this.e;
        switch (i) {
            case 3:
                int i2 = bo.b.a;
                XposedHelpers.setObjectField(((List) obj2).get(this.d), "msgContent", str);
                fn.j.w((XC_MethodHook.MethodHookParam) obj);
                return;
            default:
                ao aoVar = (ao) obj2;
                VoteComments voteComments = (VoteComments) obj;
                int i3 = this.d;
                aoVar.getClass();
                if (!TextUtils.isEmpty(str)) {
                    fi.y.e(aoVar.e);
                    String token = aoVar.a.getToken();
                    int id = voteComments.getId();
                    t.c().j(((Vote) dq.b.b(Vote.class)).adminReply(token, id, str, 1).subscribeWith(new am(aoVar, aoVar.e, voteComments, str, i3, wVar)));
                    return;
                }
                return;
        }
    }

    public final void i(w wVar, c.a aVar, int i, int i2) {
        char c;
        int i3 = this.a;
        Object obj = this.f;
        Object obj2 = this.e;
        switch (i3) {
            case 1:
                a aVar2 = (a) obj2;
                int i4 = HookSetListAdapter.a.a;
                aVar2.setKey(aVar.getTitle());
                aVar2.setValue(aVar.getKey());
                u uVar = ((w) obj).aa;
                ArrayList arrayList = uVar.a;
                int i5 = this.d;
                arrayList.set(i5, aVar2);
                uVar.notifyItemChanged(i5);
                wVar.az();
                return;
            default:
                ao aoVar = (ao) obj2;
                VoteSubmit voteSubmit = (VoteSubmit) obj;
                int i6 = this.d;
                aoVar.getClass();
                String title = aVar.getTitle();
                title.getClass();
                int hashCode = title.hashCode();
                if (hashCode != 0x2795473e) {
                    if (hashCode != 0x30570390) {
                        if (hashCode == 0x3bebd075 && title.equals("编辑帖子")) {
                            c = 2;
                        }
                        c = 65535;
                    } else {
                        if (title.equals("更改状态")) {
                            c = 1;
                        }
                        c = 65535;
                    }
                } else {
                    if (title.equals("删除帖子")) {
                        c = 0;
                    }
                    c = 65535;
                }
                Activity activity = aoVar.e;
                if (c != 0) {
                    if (c != 1) {
                        if (c == 2) {
                            VoteSubmit voteSubmit2 = (VoteSubmit) aoVar.b.e(i6);
                            w wVar2 = new w(activity);
                            View inflate = LayoutInflater.from(activity).inflate(-2113142749, (ViewGroup) null, false);
                            int i7 = 0x7f820045;
                            LinearLayout linearLayout = (LinearLayout) i.cg(0x7f820045, inflate);
                            if (linearLayout != null) {
                                i7 = 0x7f820098;
                                TextView textView = (TextView) i.cg(0x7f820098, inflate);
                                if (textView != null) {
                                    i7 = 0x7f820099;
                                    TextView textView2 = (TextView) i.cg(0x7f820099, inflate);
                                    if (textView2 != null) {
                                        i7 = 0x7f82009a;
                                        EditText editText = (EditText) i.cg(0x7f82009a, inflate);
                                        if (editText != null) {
                                            i7 = 0x7f82009f;
                                            TextView textView3 = (TextView) i.cg(0x7f82009f, inflate);
                                            if (textView3 != null) {
                                                i7 = 0x7f820112;
                                                ImageView imageView = (ImageView) i.cg(0x7f820112, inflate);
                                                if (imageView != null) {
                                                    i7 = 0x7f8201da;
                                                    EditText editText2 = (EditText) i.cg(0x7f8201da, inflate);
                                                    if (editText2 != null) {
                                                        i7 = 0x7f8201ff;
                                                        TextView textView4 = (TextView) i.cg(0x7f8201ff, inflate);
                                                        if (textView4 != null) {
                                                            LinearLayout linearLayout2 = (LinearLayout) inflate;
                                                            e eVar = new e(linearLayout2, linearLayout, textView, textView2, editText, textView3, imageView, editText2, textView4);
                                                            wVar2.bj(fi.e.VIEW);
                                                            wVar2.bi("新功能编辑");
                                                            wVar2.ar = linearLayout2;
                                                            float f = 25;
                                                            r.e.d(-2113535903, f, textView3);
                                                            r.e.d(-2113535903, f, textView);
                                                            r.e.d(-2113535899, f, editText2);
                                                            r.e.d(-2113535899, f, editText);
                                                            editText.setHint("请详细说明需要添加功能的过程步骤、预期效果，以及您为什么需要此功能.");
                                                            textView2.setText("涉及金钱或金币等功能将不会通过审核(如果提交App和描述功能不相同,会永久禁止账号提交新功能)");
                                                            editText2.setHint("功能标题");
                                                            editText2.setText(g.w(editText2, voteSubmit2.getTitle()));
                                                            editText.setText(g.w(editText, voteSubmit2.getDesc()));
                                                            textView3.setText("保存");
                                                            textView3.setOnClickListener(new aa(aoVar, eVar, voteSubmit2, wVar2, wVar, i6));
                                                            textView.setText("取消");
                                                            textView.setOnClickListener(new m(8, wVar2));
                                                            wVar2.bk();
                                                            return;
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i7)));
                        }
                        return;
                    }
                    fi.b bVar = new fi.b();
                    if (voteSubmit.getRole() == 3) {
                        bVar.b("待定");
                        bVar.b("批准");
                    }
                    bVar.b("拒绝");
                    if (voteSubmit.getRole() == 3) {
                        bVar.b("开发中");
                        bVar.b("已完成");
                    }
                    w wVar3 = new w(activity);
                    wVar3.bj(fi.e.LIST_ITEM);
                    wVar3.aj = "修改状态";
                    wVar3.bb();
                    wVar3.ay(bVar);
                    wVar3.t = false;
                    wVar3.bb();
                    wVar3.u = false;
                    wVar3.bb();
                    wVar3.ae = new bt(aoVar, voteSubmit, i6, wVar);
                    wVar3.bk();
                    return;
                }
                w wVar4 = new w(activity);
                wVar4.bj(fi.e.MESSAGE);
                wVar4.bi("删除确认");
                wVar4.bc("是否删除帖子:" + voteSubmit.getTitle());
                wVar4.v = new ak(aoVar, voteSubmit, i6, wVar);
                wVar4.bk();
                return;
        }
    }

    public c(Object obj, Object obj2, int i, int i2) {
        this.a = i2;
        this.e = obj;
        this.f = obj2;
        this.d = i;
    }
}
